"""环境设置相关 API Router"""
from fastapi import APIRouter, Request

from api.v1.models.config import (
    HtmlBaseResponse, MemoResponse, PolicyResponse, RegisterResponse,
    BoardResponse
)
from api.v1.models.response import response_500
from api.v1.models import Tags

router = APIRouter(
    prefix="/config",
    responses={**response_500}
)


@router.get("/html",
            summary="HTML 设置查询")
async def read_config_html(request: Request) -> HtmlBaseResponse:
    """查看配置HTML所需的设置信息。"""
    return request.state.config


@router.get("/policy",
            summary="会员的条款和条件查询",
            tags=[Tags.MEMBER])
async def read_member_policy(request: Request) -> PolicyResponse:
    """
查看会员注册条款和条件。
-会员注册条款
-个人信息收集和许可条款
    """
    return request.state.config


@router.get("/member",
            summary="会员加入设置查询",
            tags=[Tags.MEMBER])
async def read_config_member(request: Request) -> RegisterResponse:
#  “查看注册会员所需的首选参数信息。”
    return request.state.config


@router.get("/memo",
            summary="发送便笺时, 设定点查询",
            tags=[Tags.MEMO])
async def read_config_memo(request: Request) -> MemoResponse:
    """发送便笺时, 1我们查找每个案例消耗的点设置信息."""
    return request.state.config


@router.get("/board",
            summary="公告栏设置查询",
            tags=[Tags.BOARD])
async def read_config_memo(request: Request) -> BoardResponse:
    """我们在公告板上查找使用的设置信息."""
    return request.state.config
